<template>
  <div class="a">
      i am {{$store.state.name}}
      <input type="text" v-model="user"/>
      <button @click="$store.commit('setName',{name:user})">修改仓库中的name</button>
  </div>
</template>
<script>
export default {
    data(){
      return{
        user:''
      }
    }
}
</script>
